#include "localtimeplay.h"
#include "mainwindow.h"
#include "localtimeplayer.h"
#include "common.h"

#include <QThread>

LocalTimePlay::LocalTimePlay(int windowNo):
		m_WindowNo(windowNo)
{
}

void LocalTimePlay::doCommand()
{
	MainWindow* mainWindow = MainWindow::instance();

	Qt::ConnectionType connectionType;
	if(QThread::currentThread() == g_MainThread)
	{
		connectionType = Qt::DirectConnection;
	}
	else
	{
		connectionType = Qt::BlockingQueuedConnection;
	}

	QMetaObject::invokeMethod(
			mainWindow
			,"setSubWindowContent"
			,connectionType
			,Q_ARG(int, m_WindowNo)
			,Q_ARG(PlayerType,LocalTime)
			,Q_ARG(ValuePacket,ValuePacket()));
}
